<?php
/**
 * The template used for displaying page content in index.php
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 * @since Twenty Eleven 1.0
 */
?>

<div id="post-<?php the_ID(); ?>" <?php post_class('index');?>>
        <?php 
          $content =  explode('<!--contentpartdivider-->',get_the_content());
          $post->post_content = $content[1];
          setup_postdata($post);
        ?>
  
	<div class="entry-header">
            <h1 class="entry-title">
            <?php if(count($content) > 2): ?>
              <a href="<?php the_permalink(get_the_ID()); ?>">
                <?php the_title(); ?>
              </a>
            <?php else: ?>
              <?php the_title(); ?>
            <?php endif; ?>
            </h1>
	</div><!-- .entry-header -->
        
	<div class="entry-content">
		<?php the_content(); ?>
		<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
	</div><!-- .entry-content -->
        
        <?php if(count($content) > 2): ?>
          <a href="<?php the_permalink(get_the_ID()); ?>" class="button_custom2"><span>więcej...</span></a>
        <?php endif; ?>
          
	<div class="entry-meta">
		<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
	</div><!-- .entry-meta -->
        
</div><!-- #post-<?php the_ID(); ?> -->
